﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="MantenimientoEvento.aspx.cs" Inherits="UIWeb.MantenimientoEvento" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3>
        Mantenimiento de Eventos</h3>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <%--<asp:UpdateProgress ID="UpdateProgress1" runat="server">
     <ProgressTemplate>
            <div id="ovUp" runat="server" class="over">
                Cargando...
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>--%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div>
                <div class="form" style="float: left;">
                    <div>
                        Fecha:
                    </div>
                    <div>
                        <div class="formInput">
                            <asp:TextBox ID="txtFecha" runat="server" Style="float: left; margin-right: 10px;
                                width: 80px;"></asp:TextBox>
                            <asp:TextBox ID="txtStartTime" runat="server" Style="float: left;" Text='<%# Bind("StartTime", "{0:t}") %>'
                                Width="120px"></asp:TextBox>
                            <div style="float: left;">
                                <asp:RequiredFieldValidator ID="RFNombre" runat="server" ErrorMessage="Campo Requerido"
                                    ValidationGroup="All" ControlToValidate="txtFecha" ForeColor="Red">*</asp:RequiredFieldValidator>
                            </div>
                            <asp:MaskedEditExtender ID="meeStartTime" runat="server" AcceptAMPM="true" MaskType="Time"
                                Mask="99:99" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError"
                                ErrorTooltipEnabled="true" UserTimeFormat="None" TargetControlID="txtStartTime"
                                InputDirection="LeftToRight" AcceptNegative="Left">
                            </asp:MaskedEditExtender>
                            <asp:MaskedEditValidator ID="mevStartTime" runat="server" ControlExtender="meeStartTime"
                                ControlToValidate="txtStartTime" IsValidEmpty="False" EmptyValueMessage="Ingresar hora "
                                InvalidValueMessage="Hora Invalida" Display="Dynamic" EmptyValueBlurredText="Ingresar hora "
                                InvalidValueBlurredMessage="Hora Invalida" ValidationGroup="All" />
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div>
                        <asp:Label ID="Label1" s="lblStartTimeEdit" runat="server" Text="Presione 'A' o 'P' para cambiar AM/PM"></asp:Label>
                    </div>
                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtFecha"
                        Format="dd/MM/yyyy">
                    </asp:CalendarExtender>
                    <div class="formSpacing">
                        <div>
                            Deporte:</div>
                        <asp:DropDownList CssClass="selectClass" ID="DropDownListDeportes" runat="server"
                            OnSelectedIndexChanged="DropDownListDeportes_SelectedIndexChanged" AutoPostBack="true">
                        </asp:DropDownList>
                    </div>
                    <div class="formSpacing">
                        <div>
                            Participantes:
                        </div>
                        <div style="float: left; width: 40%;">
                            <asp:ListBox ID="lstParticipantesNoSeleccionados" runat="server" Width="100%" Height="150px"
                                SelectionMode="Multiple"></asp:ListBox>
                        </div>
                        <div style="float: left;">
                            <div style="padding-left: 10px; padding-right:10px">
                                <asp:ImageButton ID="btnSeleccionarParticipantes" runat="server" ImageUrl="~/Images/flecha_Seleccion.jpg"
                                    OnClick="btnSeleccionarParticipantes_Click" Height="20px" Width="20px" />
                            </div>
                            <div style="padding-left: 10px;">
                                <asp:ImageButton ID="btnDeSeleccionarParticipantes" runat="server" ImageUrl="~/Images/flecha_deseleccion.jpg"
                                    OnClick="btnDeSeleccionarParticipantes_Click" Height="20px" Width="20px" />
                            </div>
                        </div>
                        <div style="float: left;  width: 40%;">
                            <asp:ListBox ID="lstParticipantesSeleccionados" runat="server" Width="100%" Height="150px"
                                SelectionMode="Multiple"></asp:ListBox>
                        </div>
                        <div class="clear">
                        </div>
                       </div>
                    <div class="formSpacing">
                        <div class="clear">
                        </div>
                        <br />
                        <div>
                            <asp:LinkButton ID="lnkAlta" runat="server" CssClass="lnkbtn" OnClick="lnkAlta_Click"
                                ValidationGroup="All">Alta</asp:LinkButton>
                            <asp:LinkButton ID="lnkModificar" runat="server" CssClass="lnkbtn" OnClick="lnkModificar_Click"
                                ValidationGroup="All">Modificar</asp:LinkButton>
                            <asp:LinkButton ID="lnkEliminar" runat="server" CssClass="lnkbtn" OnClick="lnkEliminar_Click">Eliminar</asp:LinkButton>
                        </div>
                        <br />
                        <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" ValidationGroup="All" />
                    </div>
                </div>
                <div style="float: right; width: 520px;">
                 <div id="grillaEventos">
                <asp:GridView ID="GridViewEventos" runat="server" 
                    AutoGenerateColumns="False" Width="493px" CellPadding="4" ForeColor="#333333" 
                    GridLines="None" OnRowCommand="GridViewEventos_RowCommand" AllowPaging="True" 
                        onpageindexchanging="GridViewEventos_PageIndexChanging" DataKeyNames="Id" 
                         ShowHeaderWhenEmpty="True" 
                         onselectedindexchanged="GridViewEventos_SelectedIndexChanged" 
                         PageSize="50">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" >
                        <ItemStyle Width="60px" />
                        </asp:CommandField>
                        <asp:BoundField DataField="Id" HeaderText="Id" Visible="false" SortExpression="Id" />
                        <asp:BoundField DataField="FechaHoraFormat"  HeaderText="Fecha y Hora" 
                            SortExpression="FechaHoraFormat" >
                         <ItemStyle Width="120px" />
                        </asp:BoundField>
                         <asp:BoundField DataField="DeporteNombre" HeaderText="Deporte" 
                            SortExpression="DeporteNombre" >                          
                        <ItemStyle Width="120px" />
                        </asp:BoundField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>                                              
                                &nbsp;<asp:LinkButton ID="ImageButton3" runat="server" CausesValidation="False"
                                    CommandName="Edit" Text="+Resultado"  CommandArgument='<%#Eval("Id")%>'/>                               
                            </ItemTemplate>
                            <ControlStyle Height="20px" Width="20px" />
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
            </div>
           
                </div>
                <div class="clear">
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSeleccionarParticipantes" />
            <asp:AsyncPostBackTrigger ControlID="btnDeSeleccionarParticipantes" />
            <asp:AsyncPostBackTrigger ControlID="DropDownListDeportes" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
